package zxs.sino.elite.hub.enums.article;

import zxs.sino.elite.hub.enums.BaseEnum;

/**
 * 文章类型
 *
 * @author zhang
 */
public enum ArticleType implements BaseEnum<Integer> {

    BLOG(1, "博客"),
    CONTENT(2, "动态");

    private final int code;
    private final String value;

    ArticleType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isBlog(Integer code) {
        return BaseEnum.isType(ArticleType.class, code, BLOG);
    }

    public static boolean isDynamic(Integer code) {
        return BaseEnum.isType(ArticleType.class, code, CONTENT);
    }
}
